﻿@using MealBooking.Core.Models.Orders;
@model Order
@{
    var order = Model;
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<!--Navbar-->
<div data-role="navbar" data-iconpos="left">
    <div class="float-left">
        <div data-role="controlgroup" data-type="horizontal" data-inset="true" data-mini="true"
            data-theme="c">
            <a href="@Url.Action("Index", "Meal")">Add Meal</a>
        </div>
    </div>
    <div class="float-right">
        <div data-role="controlgroup" data-type="horizontal" data-inset="true" data-mini="true"
            data-theme="c">
            <a href="@Url.Action("CustomersTodayOrders")">Customers' Orders</a> <a href="@Url.Action("HistoryOrder")">
                History Orders</a>
        </div>
    </div>
</div>
<!--Navbar End-->
<ul data-role="listview" data-inset="true" data-mini="true">
    @{
        if (order != null && order.MealsWithSum != null)
        {
        <li data-role="list-divider">Today Order<span class="ui-li-count">@order.MealsWithSum.Sum(m => m.MealSum)</span></li>
        <li><a title="view detail..." href="@Url.Action("TodayOrder")">
            <p>
                <strong>@order.ToString()</strong><br />
                [Total Price: @order.TotalPrice]
            </p>
        </a></li>
        }
        else
        {
        <li data-role="list-divider">Today Order</li>
        <li><a href="@Url.Action("Index", "Meal")">No Meals Yet. Click to Add New...</a>
        </li>            
        }
    }
</ul>
